package com.dianping.cat.alarm.rule.entity;

import com.dianping.cat.alarm.rule.BaseEntity;
import com.dianping.cat.alarm.rule.IVisitor;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;




public class Rule
  extends BaseEntity<Rule>
{
  private String m_id;
/*  17 */   private List<MetricItem> m_metricItems = new ArrayList();

/*  19 */   private List<Config> m_configs = new ArrayList();

/*  21 */   private Map<String, String> m_dynamicAttributes = new LinkedHashMap();





/*  27 */   public Rule(String id) { this.m_id = id; }




  public void accept(IVisitor visitor) { visitor.visitRule(this); }

  
  public Rule addConfig(Config config) {
    this.m_configs.add(config);
/*  37 */     return this;
  }
  
  public Rule addMetricItem(MetricItem metricItem) {
/*  41 */     this.m_metricItems.add(metricItem);
/*  42 */     return this;
  }

  
  public boolean equals(Object obj) {
/*  47 */     if (obj instanceof Rule) {
/*  48 */       Rule _o = (Rule)obj;

/*  50 */       if (!equals(getId(), _o.getId())) {
/*  51 */         return false;
      }
      
/*  54 */       return true;
    }
    
/*  57 */     return false;
  }

  
/*  61 */   public String getDynamicAttribute(String name) { return (String)this.m_dynamicAttributes.get(name); }



/*  65 */   public Map<String, String> getDynamicAttributes() { return this.m_dynamicAttributes; }



/*  69 */   public List<Config> getConfigs() { return this.m_configs; }



/*  73 */   public String getId() { return this.m_id; }



/*  77 */   public List<MetricItem> getMetricItems() { return this.m_metricItems; }






  
  public void mergeAttributes(Rule other) {
/*  91 */     assertAttributeEquals(other, "rule", "id", this.m_id, other.getId());

/*  93 */     for (Map.Entry<String, String> e : other.getDynamicAttributes().entrySet()) {
/*  94 */       this.m_dynamicAttributes.put(e.getKey(), e.getValue());
    }
  }


  
/* 100 */   public void setDynamicAttribute(String name, String value) { this.m_dynamicAttributes.put(name, value); }

  
  public Rule setId(String id) {
/* 104 */     this.m_id = id;
/* 105 */     return this;
  }
  
  public Rule() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/rule/entity/Rule.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */